#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
const int N = 1e5 + 10;
int a[N], pre[N], back[N];

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int n; cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    int mx = 0;
    for (int i = 1; i <= n; i++) {
        if (a[i] > mx) mx = a[i];
        pre[i] = mx;
    }
    mx = 0;
    for (int i = n; i >= 1; i--) {
        if (a[i] > mx) mx = a[i];
        back[i] = mx;
    }
    int ans = 0;
    for (int i = 2; i < n; i++) {
        ans = max(ans, (pre[i - 1] + back[i + 1]) / a[i]);
    }
    cout << ans << endl;
    return 0;
}